home *** CD-ROM | disk | FTP | other *** search
/ fxPAINT 1.0 / fxPAINT 1.0.iso / developers / plugins / includes / fxpaint / fxpaint_api.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-12  |  7.7 KB  |  131 lines

  1. /* fxPAINT-API defines
  2.    ©1999 by Felix Schwarz / Innovative
  3.    All rights reserved.
  4. */
  5.  
  6. #ifndef _fxpaint_api_h
  7. #define _fxpaint_api_h 1
  8.  
  9. #include <fxpaint/fxPLUGIN.h>
  10.  
  11. #define get_activewin()                         fxpaint_api(FX_METHOD_GET, FX_ACTIVE_WIN,    0, 0, 0,0)
  12. #define get_win_existance(win)                  ((BOOL) fxpaint_api(FX_METHOD_GET, FX_WIN_EXISTANCE, win, 0, 0,0))
  13. #define get_win_numberoflayers(win)             fxpaint_api(FX_METHOD_GET, FX_WIN_NUMBEROFLAYERS, win, 0, 0,0)
  14. #define get_win_layerdataptr(win,layer)         ((struct fsbitmap *) fxpaint_api(FX_METHOD_GET, FX_WIN_LAYER, win, layer, 0, 0))
  15. #define get_win_fgimage(win,layer)              ((struct fsbitmap *) fxpaint_api(FX_METHOD_GET, FX_WIN_FG_IMAGE, win, layer, 0, 0))
  16. #define get_win_bgimage(win,layer)              ((struct fsbitmap *) fxpaint_api(FX_METHOD_GET, FX_WIN_BG_IMAGE, win, layer, 0, 0))
  17. #define get_win_filename(win)                   ((UBYTE *) fxpaint_api(FX_METHOD_GET, FX_WIN_FILENAME, win, 0, 0, 0))
  18.  
  19. #define gui_zoom_plus(win)                      fxpaint_api(FX_METHOD_PERFORM, FX_WIN_ZOOM_PLUS, win, 0,0,0)
  20. #define gui_zoom_minus(win)                     fxpaint_api(FX_METHOD_PERFORM, FX_WIN_ZOOM_MINUS, win, 0,0,0)
  21. #define gui_zoom_value(win)                     fxpaint_api(FX_METHOD_PERFORM, FX_WIN_GETZOOM, win, 0,0,0)
  22.  
  23. #define gui_get_slider(id,gad)                  fxpaint_api(FX_METHOD_GET, FX_GUI_SLIDER,   id, gad, 0, 0)
  24. #define gui_get_checkbox(id,gad)                fxpaint_api(FX_METHOD_GET, FX_GUI_CHECKBOX, id, gad, 0, 0)
  25. #define gui_set_slider(id,gad,val)              fxpaint_api(FX_METHOD_SET, FX_GUI_SLIDER,   id, gad, val, 0)
  26. #define gui_set_checkbox(id,gad,val)            fxpaint_api(FX_METHOD_SET, FX_GUI_CHECKBOX, id, gad, val, 0)
  27.  
  28. #define get_myfxwinid()                         fxpaint_api(FX_METHOD_GET, FX_GUI_MY_FX_WIN_ID,0,0,0,0)
  29. #define get_gui_screen()                        ((struct Screen *) fxpaint_api(FX_METHOD_GET, FX_GUI_SCREEN,0,0,0,0))
  30. #define get_gui_drawinfo()                      ((struct DrawInfo *) fxpaint_api(FX_METHOD_GET, FX_GUI_DRAWINFO,0,0,0,0))
  31. #define get_gui_visualinfo()                    ((APTR) fxpaint_api(FX_METHOD_GET, FX_GUI_VISUALINFO,0,0,0,0))
  32. #define get_gui_buttonclass()                   ((Class *) fxpaint_api(FX_METHOD_GET, FX_GUI_BUTTON_CLASS_PTR, 0, 0, 0, 0))
  33. #define get_gui_imageclass()                    ((Class *) fxpaint_api(FX_METHOD_GET, FX_GUI_IMAGE_CLASS_PTR, 0, 0, 0, 0))
  34. #define get_gui_sliderclass()                   ((Class *) fxpaint_api(FX_METHOD_GET, FX_GUI_SLIDER_CLASS_PTR, 0, 0, 0, 0))
  35. #define get_gui_checkboxclass()                 ((Class *) fxpaint_api(FX_METHOD_GET, FX_GUI_CHECKBOX_CLASS_PTR, 0, 0, 0, 0))
  36. #define get_gui_gaugeclass()                    ((Class *) fxpaint_api(FX_METHOD_GET, FX_GUI_GAUGE_CLASS_PTR, 0, 0, 0, 0))
  37. #define get_gui_cycleclass()                    ((Class *) fxpaint_api(FX_METHOD_GET, FX_GUI_CYCLE_CLASS_PTR, 0, 0, 0, 0))
  38. #define get_gui_popupclass()                    ((Class *) fxpaint_api(FX_METHOD_GET, FX_GUI_POPUP_CLASS_PTR, 0, 0, 0, 0))
  39.  
  40. #define get_ghei()                              fxpaint_api(FX_METHOD_GET, FX_GUI_GHEI, 0, 0, 0, 0)
  41.  
  42. #define addport_sigmask(sigmask,pluginid)       fxpaint_api(FX_METHOD_PERFORM, FX_PLUGIN_ADDPORT, sigmask, pluginid,0,0)
  43. #define remport_sigmask(sigmask,pluginid)       fxpaint_api(FX_METHOD_PERFORM, FX_PLUGIN_REMPORT, sigmask, pluginid,0,0)
  44.  
  45. #define fxp_loadpic(pic)                        ((struct fsbitmap *) fxpaint_api(FX_METHOD_PERFORM, FX_PLUGIN_LOADPIC, (ULONG) pic, 0, 0, 0))
  46. #define fx_recalc()                             fxpaint_api(FX_METHOD_PERFORM, FX_PLUGIN_FXRECALC, 0,0,0,0)
  47. #define gui_closenfree(win)                     fxpaint_api(FX_METHOD_PERFORM, FX_PLUGIN_GUI_CLOSENFREE, win,0,0,0)
  48. #define fx_find_str_in_buf(buf,buflen,fndstr)   ((BOOL) fxpaint_api(FX_METHOD_PERFORM, FX_PLUGIN_FIND_STR_IN_BUF, (ULONG) buf, (ULONG) buflen, (ULONG) fndstr,0))
  49. #define fs_allocbitmap(width,height,type)       ((struct fsbitmap *) fxpaint_api(FX_METHOD_PERFORM, FX_PLUGIN_FSALLOCBITMAP, (ULONG) width, (ULONG) height, (ULONG) type,0))
  50. #define fs_freebitmap(fsbit)                    fxpaint_api(FX_METHOD_PERFORM, FX_PLUGIN_FSFREEBITMAP,  (ULONG) fsbit, 0, 0, 0)
  51. #define CstAllocVec(size, flags)                ((APTR) fxpaint_api(FX_METHOD_PERFORM, FX_PLUGIN_CSTALLOCVEC, (ULONG) size, (ULONG) flags, 0, 0))
  52. #define CstFreeVec(mem)                         fxpaint_api(FX_METHOD_PERFORM, FX_PLUGIN_CSTFREEVEC,  (ULONG) mem, 0, 0, 0)
  53.  
  54. #define fs_floyd_dither(source,palette)          ((struct fsbitmap *) fxpaint_api(FX_METHOD_PERFORM,FX_FSLIB_DITHERTO256,(ULONG) source, (ULONG) palette,0,0))
  55. #define fs_ordered_dither(source,palette)        ((struct fsbitmap *) fxpaint_api(FX_METHOD_PERFORM,FX_FSLIB_DITHERTO256FAST,(ULONG) source, (ULONG) palette,0,0))
  56. #define fs_scalecopybitmap(source,newwid,newhei) ((struct fsbitmap *) fxpaint_api(FX_METHOD_PERFORM,FX_FSLIB_SCALECOPY  ,(ULONG) source, newwid, newhei,0))
  57. #define fs_clonebitmap(source)                   ((struct fsbitmap *) fxpaint_api(FX_METHOD_PERFORM,FX_FSLIB_CLONEBITMAP,(ULONG) source, 0, 0, 0))
  58.  
  59. #define fx_merge(win,rect)                       ((struct fsbitmap *) fxpaint_api(FX_METHOD_PERFORM, FX_WIN_MERGE, win, (ULONG) rect, 0, 0))
  60.  
  61. #define asl_filereq(file,title)                  ((UBYTE *) fxpaint_api(FX_METHOD_PERFORM, FX_ASL_FILEREQUESTER, (ULONG) file, (ULONG) title, 0,0))
  62.  
  63. #define dbg_msg(msg)                             fxpaint_api(FX_METHOD_PERFORM, FX_DEBUG_WRITETEXT, msg, 0, 0, 0)
  64. #define dbg_num(msg,num)                         fxpaint_api(FX_METHOD_PERFORM, FX_DEBUG_WRITETEXTNUMBER, msg, num, 0, 0)
  65.  
  66. #define GAD_DISTX                                ((long) fxpaint_api(FX_METHOD_GET, FX_GUI_DISTX, 0,0,0,0))
  67. #define GAD_DISTY                                ((long) fxpaint_api(FX_METHOD_GET, FX_GUI_DISTY, 0,0,0,0))
  68.  
  69. struct fsbitmap
  70. {
  71.    APTR location;
  72.    LONG width;  // The width  of the bitmap
  73.    LONG height; // The height of the bitmap
  74.    LONG type;   // Type of the bitmap (either 1 for Chunky or 3 for RGB)
  75. };
  76.  
  77. typedef struct tagFX_GUI
  78. {
  79.         struct Gadget *glist;
  80.         struct Gadget *gads[100];
  81.         struct Window *win;
  82.         long   min_iw;
  83.         long   min_ih;
  84.         long   min_ixp; /* Minimale X-Verschiebung in einem Fenster */
  85.         long   min_iyp; /*          Y*/
  86. }FXGUI;
  87.  
  88. /* Defines for the fxPAINT-GUI-engine*/
  89. #define GUI_BUTTON 1L
  90. #define GUI_STRING 2L
  91. #define GUI_CYCLE  3L
  92. #define GUI_SLIDER 4L
  93. #define GUI_ONEBUTTONBAR 5L
  94. #define GUI_CANCELBAR 6L
  95. #define GUI_VERTSPACE 7L
  96. #define GUI_CHECKBOX  8L
  97. #define GUI_SIZEPAIR  9L
  98. #define GUI_INTEGER  10L
  99. #define GUI_SELWIND  11L
  100. #define GUI_LISTVIEW 12L
  101. #define GUI_GAMMASLIDER 13L
  102. #define GUI_RLISTVIEW 14L
  103. #define GUI_TEXT      15L
  104. #define GUI_POPUP     16L
  105. #define GUI_PLACETXTD 17L
  106. #define GUI_RGBSLIDER 18L
  107.  
  108. #define GUI_CHECKON  1L
  109. #define GUI_CHECKOFF 0L
  110.  
  111. #define GUI_RGT PLACETEXT_RIGHT
  112.  
  113. #define BORDER_RIGHT 18L
  114. #define BORDER_BOTTOM 10L
  115. #define HLINER_DIST  2L
  116.  
  117. #define STD_SIZE_IDCMP IDCMP_CLOSEWINDOW|IDCMP_MENUPICK|IDCMP_MOUSEBUTTONS|IDCMP_ACTIVEWINDOW|IDCMP_GADGETUP|IDCMP_NEWSIZE|IDCMP_GADGETHELP|IDCMP_IDCMPUPDATE
  118. #define STD_SIZESLIDE_IDCMP IDCMP_CLOSEWINDOW|IDCMP_MENUPICK|IDCMP_MOUSEBUTTONS|IDCMP_ACTIVEWINDOW|IDCMP_GADGETUP|IDCMP_NEWSIZE|SLIDERIDCMP|IDCMP_GADGETHELP|IDCMP_IDCMPUPDATE
  119. #define STD_SIZESLIDETICK_IDCMP IDCMP_CLOSEWINDOW|IDCMP_MENUPICK|IDCMP_MOUSEBUTTONS|IDCMP_ACTIVEWINDOW|IDCMP_GADGETUP|IDCMP_NEWSIZE|SLIDERIDCMP|IDCMP_INTUITICKS|IDCMP_GADGETHELP|IDCMP_IDCMPUPDATE
  120. #define STD_SIZESLIDELIST_IDCMP IDCMP_CLOSEWINDOW|IDCMP_MENUPICK|IDCMP_MOUSEBUTTONS|IDCMP_ACTIVEWINDOW|IDCMP_GADGETUP|IDCMP_NEWSIZE|SLIDERIDCMP|LISTVIEWIDCMP|IDCMP_GADGETHELP|IDCMP_IDCMPUPDATE
  121.  
  122. #define DRAW_UNSEL 0L
  123. #define DRAW_SEL   1L
  124.  
  125. #define FLEX_NEXT 100
  126. #define FLEX_LAST 0
  127.  
  128. #define GADGETID(x) (((struct Gadget *)(x->IAddress))->GadgetID)
  129.  
  130. #endif
  131.